Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jest-changed-files): only return files from getChangedFilesFromRoots #7961

Merged
merged 2 commits into from
Feb 22, 2019

Conversation

jumoel
Copy link
Contributor

@jumoel jumoel commented Feb 22, 2019

Summary

Fixes #7956.

Previously, getChangedFilesFromRoots would return parts of commit messages as if they were files, if the commit message contained multiple paragraphs of text.

Test plan

I've updated the e2e tests in jestChangedFiles.test.js to include a commit message that includes multiple paragraphs (for both hg and git).

I decided on augmenting existing tests instead of making new ones to prevent an increase in running time.

In the case of hg, one of the files in the repository has had its contents changed to be on multiple lines, and one of the commits to be made with hg commit -l filename

It could have been done with sh -c echo "line1\\nline2" | hg commit -l -", but that would have required a change of functionality in Utils.js#run, which I didn't feel like. 😄

For git, the multiline commit message is made with multiple -m parameters, which puts the different messages in separate paragraphs.

Previously, the function would return parts of commit
messages as if they were files, if the commit message
contained multiple paragraphs of text.
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you!

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getChangedFilesForRoots returns things that aren't files
3 participants